/**
////////////////////////////////////////////////////////////////////////////////
//                                                                            // 
//  Copyright (c) 2013 Santiago Benito Rebollo. Eclipse Public License - v 1.0//
//  @author Santiago Benito Rebollo.                                          // 
//  santiago.benito.rebollo@gmail.com                                         //
//                                                                            //  
////////////////////////////////////////////////////////////////////////////////
//                                                                            //
// THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC// 
// LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM//
// CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.                      //
//                                                                            //
// A Contributor may choose to distribute the Program in object code form     //
// under its own license agreement, provided that:                            //
//                                                                            //
// a) it complies with the terms and conditions of this Agreement; and        //
// b) its license agreement:                                                  //
//                                                                            //
// i) effectively disclaims on behalf of all Contributors all warranties and  //
// conditions, express and implied, including warranties or conditions of     //  
// title and non-infringement, and implied warranties or conditions of        //
// merchantability and fitness for a particular purpose;                      //
// ii) effectively excludes on behalf of all Contributors all liability for   //
// damages, including direct, indirect, special, incidental and consequential //
// damages, such as lost profits;                                             //
// iii) states that any provisions which differ from this Agreement are       //
// offered by that Contributor alone and not by any other party; and          //
// iv) states that source code for the Program is available from such         //
// Contributor, and informs licensees how to obtain it in a reasonable        //
// manner on or through a medium customarily used for software exchange.      //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
 */

/**
CmIdentification
////////////////////////////////////////////////////////////////////////////////
// Version History:
// [Rev d.d dd Mmm yyyy hh:mm:ss    <logComment>]
$Log: TestDijkstra.java,v $
////////////////////////////////////////////////////////////////////////////////
 */

package com.chago.fastrecado;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.List;

/**
 * This class has the main method for running the algorithm.
 * 
 * @author Santiago Benito Rebollo
 * @author santiago.benito.rebollo@gmail.com
 */
public class TestDijkstra {



    /**
     * This is the main. All of this method is only for testing and the code could not be "ethical"
     * 
     * @param String[] args is not used
     * @pre $none
     * @post $none
     */
/*
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		InputStreamReader isr = new InputStreamReader (System.in);
		BufferedReader br = new BufferedReader(isr);
		int intSource=-1;
		int intTarget=-1;
		boolean booDistanceTime=true; //true=distance  false=time 
		String strDistanceTime="";
		Vertice[] MapOfCities = DataLoader.buildMap("http://www.cookiesmania.es/ciudades2.txt");
		// show the cities
		DataLoader.showCities (MapOfCities);
		DataLoader.showCityList (MapOfCities);
		// select the source and the target 
		while ( (intSource<0)||(intSource>MapOfCities.length)) {
		System.out.println ("Which number is the SOURCE city?");
		String str_source;
			try {
				str_source = br.readLine();
				intSource = Integer.parseInt(str_source);
			} catch (Exception e) {
				
				intSource=-1;
				e.printStackTrace();
					
			} 
		}
		while ( (intTarget<0)||(intTarget>MapOfCities.length)) {
			System.out.println ("Which number is the TARGET city?");
			String str_target;
			try {
			
				str_target = br.readLine();
				intTarget = Integer.parseInt(str_target);
			} catch (Exception e) {
				intTarget=-1;
				e.printStackTrace();
			} 
		}

		while (
				(!strDistanceTime.toUpperCase().equals("D"))&&
				(!strDistanceTime.toUpperCase().equals("T"))
				) {
			System.out.println ("Shortest path by Distance (D) or by Time (T)?");
			try {
				strDistanceTime = br.readLine();
			} catch (Exception e) {
				
				strDistanceTime="";
				e.printStackTrace();
			} 
		}
	
		if (strDistanceTime.toUpperCase().equals("D")) {
				booDistanceTime=true;
		}else {
			booDistanceTime=false;
		}
		
		//Run the Dijkstra
		Dijkstra.computePaths(MapOfCities[intSource],booDistanceTime);
       	
	    System.out.println("The distance from ("+MapOfCities[intSource] +") to (" + MapOfCities[intTarget] + ") is " + MapOfCities[intTarget].minDistance);
	    List<Vertice> path = Dijkstra.getShortestPathTo(MapOfCities[intTarget]);
	    System.out.println("The path is: " + path);
        	

		
	}

*/
	
}
